Developer Documentation

QuickTime 4 API Documentation

Wired Movies and Sprites

| Previous | Chapter Contents | Chapter Top |

What You Need to Modify

DefineButton2

For defineButton2 , you need to modify or add the following fields:

File Length, ActionRecordsOffset (which is currently undocumented), the ActionOffset , the Condition , the RecordHeader size portion, and add ActionRecord .

File Length

A 32 bit field in the SWF file header.

RecordHeader for the defineButton2

The RecordHeader contains the tagID and length. You need to update the length. Note that there are short and long formats for record headers, depending on the size of the record. The tagID for defineButton2 is 34.

ActionRecordsOffset

This 16 bit field is missing from the SWF File Format Specification. It occurs in between the Flags and Buttons fields. It is initially set to zero if there are no actions for the button. If there are actions for the button, then it must contain the offset from the point in the SWF file following this 16-bit value to the beginning of the ActionOffset field.

    DefineButton2 =
        
        Header
        ButtonID
        Flags

        ActionRecordsOffset     (this is missing from the spec)

        Buttons
        ButtonEndFlag
        Button2ActionCode
        ActionOffset
        Condition
        Action          [ActionRecords]
        ActionEndFlag

ActionOffset

There is one ActionOffset per condition (mouse overDownToIdle ). This is the offset used to skip over the Condition and the following actions (the ActionRecord ) for the condition. You need to update this value when adding actions.

Condition

The condition field is roughly equivalent to a wired movie event. The actions associated with button state transition condition are triggered when the transition occurs. You need to add or edit this field.

Actions

Flash actions each have their own action tag code. QuickTime actions use a single QuickTimeActions code: 'AA' . You may add a list of actions to a single QuickTimeActions tag.

The format of the QuickTimeActions tag is as follows:

    1 byte:     Tag = 'AA'
    2 bytes:    data length (size of the QTAtomContainer)
    n bytes     the data which is the QTAtomContainer holding the wired
                actions

DoAction

For DoAction , you need to modify a subset of the defineButton2 fields in the same manner as described above. These fields are:

File Length, the RecordHeader size portion, and the ActionRecord.

Endian Issues

You need to write the length fields in little endian format.

 


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top |